home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume9 / uemacs3.8b / part08 < prev    next >
Encoding:
Internet Message Format  |  1987-03-16  |  40.9 KB

  1. Subject:  v09i040:  MicroEMACS, version 3.8b, Part08/14
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.TMC.COM
  4.  
  5. Submitted by: ihnp4!itivax!duncan!lawrence (Daniel Lawrence)
  6. Mod.sources: Volume 9, Issue 40
  7. Archive-name: uemacs3.8b/Part08
  8.  
  9. #! /bin/sh
  10. # This is a shell archive.  Remove anything before this line,
  11. # then unpack it by saving it in a file and typing "sh file".
  12. # If this archive is complete, you will see the message:
  13. #        "End of archive 8 (of 14)."
  14. # Contents:  estruct.h readme
  15. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  16. echo shar: Extracting \"estruct.h\" \(18184 characters\)
  17. if test -f estruct.h ; then 
  18.   echo shar: Will not over-write existing file \"estruct.h\"
  19. else
  20. sed "s/^X//" >estruct.h <<'END_OF_estruct.h'
  21. X/*    ESTRUCT:    Structure and preprocesser defined for
  22. X            MicroEMACS 3.8
  23. X
  24. X            written by Dave G. Conroy
  25. X            modified by Steve Wilhite, George Jones
  26. X            greatly modified by Daniel Lawrence
  27. X*/
  28. X
  29. X#ifdef    LATTICE
  30. X#undef    LATTICE        /* don't use their definitions...use ours    */
  31. X#endif
  32. X#ifdef    MSDOS
  33. X#undef    MSDOS
  34. X#endif
  35. X#ifdef    CPM
  36. X#undef    CPM
  37. X#endif
  38. X#ifdef    AMIGA
  39. X#undef    AMIGA
  40. X#endif
  41. X
  42. X/*    Version definition            */
  43. X
  44. X#define    VERSION    "3.8b"
  45. X
  46. X/*    Machine/OS definitions            */
  47. X
  48. X#define AMIGA   0                       /* AmigaDOS            */
  49. X#define ST520   0                       /* ST520, TOS                   */
  50. X#define MSDOS   1                       /* MS-DOS                       */
  51. X#define V7      0                       /* V7 UN*X or Coherent or BSD4.2*/
  52. X#define    BSD    0            /* UNIX BSD 4.2    and ULTRIX    */
  53. X#define    USG    0            /* UNIX system V        */
  54. X#define VMS     0                       /* VAX/VMS                      */
  55. X#define CPM     0                       /* CP/M-86                      */
  56. X#define    FINDER    0            /* Macintosh OS            */
  57. X
  58. X/*    Compiler definitions            */
  59. X#define MWC86   0    /* marc williams compiler */
  60. X#define    LATTICE    0    /* Lattice 2.14 thruough 3.0 compilers */
  61. X#define    AZTEC    1    /* Aztec C 3.20e */
  62. X#define    MSC    0    /* MicroSoft C compile version 3 */
  63. X#define MEGAMAX 0    /* Megamax C compiler */
  64. X
  65. X/*    Profiling options    */
  66. X#define    APROF    0    /* turn Aztec C profiling on? */
  67. X#define    NBUCK    100    /* number of buckets to profile */
  68. X#define    RAMSIZE    0    /* dynamic RAM memory usage tracking */
  69. X#define    RAMSHOW    0    /* auto dynamic RAM reporting */
  70. X
  71. X/*   Special keyboard definitions            */
  72. X
  73. X#define WANGPC    0        /* WangPC - mostly escape sequences     */
  74. X/*    Terminal Output definitions        */
  75. X
  76. X#define ANSI    0            /* ansi escape sequences    */
  77. X#define    HP150    0            /* HP150 screen driver        */
  78. X#define    HP110    0            /* HP110 screen driver        */
  79. X#define    VMSVT    0            /* various VMS terminal entries    */
  80. X#define VT52    0                       /* VT52 terminal (Zenith).      */
  81. X#define VT100   0                       /* Handle VT100 style keypad.   */
  82. X#define LK201   0                       /* Handle LK201 style keypad.   */
  83. X#define RAINBOW 0                       /* Use Rainbow fast video.      */
  84. X#define TERMCAP 0                       /* Use TERMCAP                  */
  85. X#define    IBMPC    1            /* IBM-PC CGA/MONO driver    */
  86. X#define    EGA    0            /* EGA IBM-PC specific driver    */
  87. X#define    DG10    0            /* Data General system/10    */
  88. X#define    TIPC    0            /* TI Profesional PC driver    */
  89. X#define    MAC    0            /* Macintosh            */
  90. X#define    ATARI    0            /* Atari 520/1040ST screen    */
  91. X
  92. X/*    Configuration options    */
  93. X
  94. X#define CVMVAS  1    /* arguments to page forward/back in pages    */
  95. X#define    NFWORD    1    /* forward word jumps to beginning of word    */
  96. X#define    CLRMSG    0    /* space clears the message line with no insert    */
  97. X#define    ACMODE    1    /* auto CMODE on .C and .H files        */
  98. X#define    CFENCE    1    /* fench matching in CMODE            */
  99. X#define    TYPEAH    1    /* type ahead causes update to be skipped    */
  100. X#define DEBUGM    1    /* Global SPELL mode triggers macro debugging    */
  101. X#define    VISMAC    0    /* update display during keyboard macros    */
  102. X#define    CTRLZ    0    /* add a ^Z at end of files under MSDOS only    */
  103. X
  104. X#define    REVSTA    1    /* Status line appears in reverse video        */
  105. X#define    COLOR    1    /* color commands and windows            */
  106. X
  107. X#define    FILOCK    0    /* file locking under unix BSD 4.2        */
  108. X#define    ISRCH    1    /* Incremental searches like ITS EMACS        */
  109. X#define    WORDPRO    1    /* Advanced word processing features        */
  110. X#define    FLABEL    0    /* function key label code            */
  111. X#define    APROP    1    /* Add code for Apropos command            */
  112. X#define    CRYPT    1    /* file encryption enabled?            */
  113. X#define MAGIC    1    /* include regular expression matching?        */
  114. X
  115. X#define ASCII    1    /* always using ASCII char sequences for now    */
  116. X#define EBCDIC    0    /* later IBM mainfraim versions will use EBCDIC    */
  117. X
  118. X/*    System dependant library redefinitions, structures and includes    */
  119. X
  120. X/*  Megamax C defines short to be 1 byte and int to be 2 bytes */
  121. X#if    MEGAMAX & ST520
  122. X#define SHORT int
  123. X#else
  124. X#define SHORT short
  125. X#endif
  126. X
  127. X#if    AZTEC
  128. X#undef    fputc
  129. X#undef    fgetc
  130. X#define    fputc    aputc
  131. X#define    fgetc    agetc
  132. X#define    int86    sysint
  133. X#define    intdos(a, b)    sysint(33, a, b)
  134. X#define    inp    inportb
  135. X
  136. Xstruct XREG {
  137. X    int ax,bx,cx,dx,si,di;
  138. X};
  139. X
  140. Xstruct HREG {
  141. X    char al,ah,bl,bh,cl,ch,dl,dh;
  142. X};
  143. X
  144. Xunion REGS {
  145. X    struct XREG x;
  146. X    struct HREG h;
  147. X};
  148. X#endif
  149. X
  150. X#if    MSDOS & MWC86
  151. X#include    <dos.h>
  152. X#define    int86(a, b, c)    intcall(b, c, a)
  153. X#define    inp    in
  154. X
  155. Xstruct XREG {
  156. X    int ax,bx,cx,dx,si,di,ds,es,flags;
  157. X};
  158. X
  159. Xstruct HREG {
  160. X    char al,ah,bl,bh,cl,ch,dl,dh;
  161. X    int ds,es,flags;
  162. X};
  163. X
  164. Xunion REGS {
  165. X    struct XREG x;
  166. X    struct HREG h;
  167. X};
  168. X#endif
  169. X
  170. X#if    MSDOS & MSC
  171. X#include    <dos.h>
  172. X#define    movmem(a, b, c)        memcpy(b, a, c)
  173. X#endif
  174. X
  175. X#if    MSDOS & LATTICE
  176. X#undef    CPM
  177. X#undef    LATTICE
  178. X#include    <dos.h>
  179. X#undef    CPM
  180. X#endif
  181. X
  182. X#if    VMS
  183. X#define    unlink(a)    delete(a)
  184. X#endif
  185. X
  186. X/*    define memory mapped flag    */
  187. X
  188. X#define    MEMMAP    0
  189. X
  190. X#if    IBMPC
  191. X#undef    MEMMAP
  192. X#define    MEMMAP    1
  193. X#endif
  194. X
  195. X#if    IBMMONO
  196. X#undef    MEMMAP
  197. X#define    MEMMAP    1
  198. X#endif
  199. X
  200. X#if    EGA
  201. X#undef    MEMMAP
  202. X#define    MEMMAP    1
  203. X#endif
  204. X
  205. X/*    internal constants    */
  206. X
  207. X#define    NBINDS    256            /* max # of bound keys        */
  208. X#define NFILEN  80                      /* # of bytes, file name        */
  209. X#define NBUFN   16                      /* # of bytes, buffer name      */
  210. X#define NLINE   256                     /* # of bytes, line             */
  211. X#define    NSTRING    128            /* # of bytes, string buffers    */
  212. X#define NKBDM   256                     /* # of strokes, keyboard macro */
  213. X#define NPAT    128                     /* # of bytes, pattern          */
  214. X#define HUGE    1000                    /* Huge number                  */
  215. X#define    NLOCKS    100            /* max # of file locks active    */
  216. X#define    NCOLORS    8            /* number of supported colors    */
  217. X#define    KBLOCK    250            /* sizeof kill buffer chunks    */
  218. X#define    NBLOCK    16            /* line block chunk size    */
  219. X#define    NVSIZE    10            /* max #chars in a var name    */
  220. X
  221. X#if    0
  222. X#define AGRAVE  0x60                    /* M- prefix,   Grave (LK201)   */
  223. X#define METACH  0x1B                    /* M- prefix,   Control-[, ESC  */
  224. X#define CTMECH  0x1C                    /* C-M- prefix, Control-\       */
  225. X#define EXITCH  0x1D                    /* Exit level,  Control-]       */
  226. X#define CTRLCH  0x1E                    /* C- prefix,   Control-^       */
  227. X#define HELPCH  0x1F                    /* Help key,    Control-_       */
  228. X#endif
  229. X
  230. X#define CTRL    0x0100                  /* Control flag, or'ed in       */
  231. X#define META    0x0200                  /* Meta flag, or'ed in          */
  232. X#define CTLX    0x0400                  /* ^X flag, or'ed in            */
  233. X#define    SPEC    0x0800            /* special key (function keys)    */
  234. X
  235. X#define FALSE   0                       /* False, no, bad, etc.         */
  236. X#define TRUE    1                       /* True, yes, good, etc.        */
  237. X#define ABORT   2                       /* Death, ^G, abort, etc.       */
  238. X#define    FAILED    3            /* not-quite fatal false return    */
  239. X#define    RET    4            /* a return from buffer        */
  240. X#define    GOLINE    5            /* exit flagging a GOTO        */
  241. X
  242. X#define    STOP    0            /* keyboard macro not in use    */
  243. X#define    PLAY    1            /*          playing    */
  244. X#define    RECORD    2            /*          recording    */
  245. X
  246. X#define    FORWARD    0            /* forward direction        */
  247. X#define REVERSE    1            /* backwards direction        */
  248. X
  249. X#define FIOSUC  0                       /* File I/O, success.           */
  250. X#define FIOFNF  1                       /* File I/O, file not found.    */
  251. X#define FIOEOF  2                       /* File I/O, end of file.       */
  252. X#define FIOERR  3                       /* File I/O, error.             */
  253. X#define    FIOLNG    4            /* line longer than allowed len    */
  254. X#define    FIOFUN    5            /* File I/O, eod of file/bad line*/
  255. X
  256. X#define CFCPCN  0x0001                  /* Last command was C-P, C-N    */
  257. X#define CFKILL  0x0002                  /* Last command was a kill      */
  258. X
  259. X#define    BELL    0x07            /* a bell character        */
  260. X#define    TAB    0x09            /* a tab character        */
  261. X
  262. X#if    V7 | USG | BSD
  263. X#define    PATHCHR    ':'
  264. X#else
  265. X#define    PATHCHR    ';'
  266. X#endif
  267. X
  268. X#define    INTWIDTH    sizeof(int)/3 + 2
  269. X
  270. X/*    Macro argument token types                    */
  271. X
  272. X#define    TKNUL    0            /* end-of-string        */
  273. X#define    TKARG    1            /* interactive argument        */
  274. X#define    TKBUF    2            /* buffer argument        */
  275. X#define    TKVAR    3            /* user variables        */
  276. X#define    TKENV    4            /* environment variables    */
  277. X#define    TKFUN    5            /* function....            */
  278. X#define    TKDIR    6            /* directive            */
  279. X#define    TKLBL    7            /* line label            */
  280. X#define    TKLIT    8            /* numeric literal        */
  281. X#define    TKSTR    9            /* quoted string literal    */
  282. X#define    TKCMD    10            /* command name            */
  283. X
  284. X/*    Internal defined functions                    */
  285. X
  286. X/* DIFCASE represents the integer difference between upper
  287. X   and lower case letters.  It is an xor-able value, which is
  288. X   fortunate, since the relative positions of upper to lower
  289. X   case letters is the opposite of ascii in ebcdic.
  290. X*/
  291. X
  292. X#ifdef    islower
  293. X#undef    islower
  294. X#endif
  295. X
  296. X#if    ASCII
  297. X
  298. X#define    DIFCASE        0x20
  299. X#define isletter(c)    (('a' <= c && 'z' >= c) || ('A' <= c && 'Z' >= c))
  300. X#define islower(c)    (('a' <= c && 'z' >= c))
  301. X#endif
  302. X
  303. X#if    EBCDIC
  304. X
  305. X#define    DIFCASE        0x40
  306. X#define isletter(c)    (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c) || ('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
  307. X#define islower(c)    (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c))
  308. X#endif
  309. X
  310. X/*    Dynamic RAM tracking and reporting redefinitions    */
  311. X
  312. X#if    RAMSIZE
  313. X#define    malloc    allocate
  314. X#define    free    release
  315. X#endif
  316. X
  317. X/*
  318. X * There is a window structure allocated for every active display window. The
  319. X * windows are kept in a big list, in top to bottom screen order, with the
  320. X * listhead at "wheadp". Each window contains its own values of dot and mark.
  321. X * The flag field contains some bits that are set by commands to guide
  322. X * redisplay; although this is a bit of a compromise in terms of decoupling,
  323. X * the full blown redisplay is just too expensive to run for every input
  324. X * character.
  325. X */
  326. Xtypedef struct  WINDOW {
  327. X        struct  WINDOW *w_wndp;         /* Next window                  */
  328. X        struct  BUFFER *w_bufp;         /* Buffer displayed in window   */
  329. X        struct  LINE *w_linep;          /* Top line in the window       */
  330. X        struct  LINE *w_dotp;           /* Line containing "."          */
  331. X        short   w_doto;                 /* Byte offset for "."          */
  332. X        struct  LINE *w_markp;          /* Line containing "mark"       */
  333. X        short   w_marko;                /* Byte offset for "mark"       */
  334. X        char    w_toprow;               /* Origin 0 top row of window   */
  335. X        char    w_ntrows;               /* # of rows of text in window  */
  336. X        char    w_force;                /* If NZ, forcing row.          */
  337. X        char    w_flag;                 /* Flags.                       */
  338. X#if    COLOR
  339. X    char    w_fcolor;        /* current forground color    */
  340. X    char    w_bcolor;        /* current background color    */
  341. X#endif
  342. X}       WINDOW;
  343. X
  344. X#define WFFORCE 0x01                    /* Window needs forced reframe  */
  345. X#define WFMOVE  0x02                    /* Movement from line to line   */
  346. X#define WFEDIT  0x04                    /* Editing within a line        */
  347. X#define WFHARD  0x08                    /* Better to a full display     */
  348. X#define WFMODE  0x10                    /* Update mode line.            */
  349. X#define    WFCOLR    0x20            /* Needs a color change        */
  350. X
  351. X/*
  352. X * Text is kept in buffers. A buffer header, described below, exists for every
  353. X * buffer in the system. The buffers are kept in a big list, so that commands
  354. X * that search for a buffer by name can find the buffer header. There is a
  355. X * safe store for the dot and mark in the header, but this is only valid if
  356. X * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
  357. X * the buffer is kept in a circularly linked list of lines, with a pointer to
  358. X * the header line in "b_linep".
  359. X *     Buffers may be "Inactive" which means the files accosiated with them
  360. X * have not been read in yet. These get read in at "use buffer" time.
  361. X */
  362. Xtypedef struct  BUFFER {
  363. X        struct  BUFFER *b_bufp;         /* Link to next BUFFER          */
  364. X        struct  LINE *b_dotp;           /* Link to "." LINE structure   */
  365. X        short   b_doto;                 /* Offset of "." in above LINE  */
  366. X        struct  LINE *b_markp;          /* The same as the above two,   */
  367. X        short   b_marko;                /* but for the "mark"           */
  368. X        struct  LINE *b_linep;          /* Link to the header LINE      */
  369. X    char    b_active;        /* window activated flag    */
  370. X        char    b_nwnd;                 /* Count of windows on buffer   */
  371. X        char    b_flag;                 /* Flags                        */
  372. X    char    b_mode;            /* editor mode of this buffer    */
  373. X        char    b_fname[NFILEN];        /* File name                    */
  374. X        char    b_bname[NBUFN];         /* Buffer name                  */
  375. X#if    CRYPT
  376. X    char    b_key[NPAT];        /* current encrypted key    */
  377. X#endif
  378. X}       BUFFER;
  379. X
  380. X#define BFINVS  0x01                    /* Internal invisable buffer    */
  381. X#define BFCHG   0x02                    /* Changed since last write     */
  382. X
  383. X/*    mode flags    */
  384. X#define    NUMMODES    8        /* # of defined modes        */
  385. X
  386. X#define    MDWRAP    0x0001            /* word wrap            */
  387. X#define    MDCMOD    0x0002            /* C indentation and fence match*/
  388. X#define    MDSPELL    0x0004            /* spell error parcing        */
  389. X#define    MDEXACT    0x0008            /* Exact matching for searches    */
  390. X#define    MDVIEW    0x0010            /* read-only buffer        */
  391. X#define MDOVER    0x0020            /* overwrite mode        */
  392. X#define MDMAGIC    0x0040            /* regular expresions in search */
  393. X#define    MDCRYPT    0x0080            /* encrytion mode active    */
  394. X
  395. X/*
  396. X * The starting position of a region, and the size of the region in
  397. X * characters, is kept in a region structure.  Used by the region commands.
  398. X */
  399. Xtypedef struct  {
  400. X        struct  LINE *r_linep;          /* Origin LINE address.         */
  401. X        short   r_offset;               /* Origin LINE offset.          */
  402. X        long    r_size;                 /* Length in characters.        */
  403. X}       REGION;
  404. X
  405. X/*
  406. X * All text is kept in circularly linked lists of "LINE" structures. These
  407. X * begin at the header line (which is the blank line beyond the end of the
  408. X * buffer). This line is pointed to by the "BUFFER". Each line contains a the
  409. X * number of bytes in the line (the "used" size), the size of the text array,
  410. X * and the text. The end of line is not stored as a byte; it's implied. Future
  411. X * additions will include update hints, and a list of marks into the line.
  412. X */
  413. Xtypedef struct  LINE {
  414. X        struct  LINE *l_fp;             /* Link to the next line        */
  415. X        struct  LINE *l_bp;             /* Link to the previous line    */
  416. X        short   l_size;                 /* Allocated size               */
  417. X        short   l_used;                 /* Used size                    */
  418. X        char    l_text[1];              /* A bunch of characters.       */
  419. X}       LINE;
  420. X
  421. X#define lforw(lp)       ((lp)->l_fp)
  422. X#define lback(lp)       ((lp)->l_bp)
  423. X#define lgetc(lp, n)    ((lp)->l_text[(n)]&0xFF)
  424. X#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
  425. X#define llength(lp)     ((lp)->l_used)
  426. X
  427. X/*
  428. X * The editor communicates with the display using a high level interface. A
  429. X * "TERM" structure holds useful variables, and indirect pointers to routines
  430. X * that do useful operations. The low level get and put routines are here too.
  431. X * This lets a terminal, in addition to having non standard commands, have
  432. X * funny get and put character code too. The calls might get changed to
  433. X * "termp->t_field" style in the future, to make it possible to run more than
  434. X * one terminal type.
  435. X */
  436. Xtypedef struct  {
  437. X    short    t_mrow;            /* max number of rows allowable */
  438. X        short   t_nrow;                 /* current number of rows used  */
  439. X        short   t_mcol;                 /* max Number of columns.       */
  440. X        short   t_ncol;                 /* current Number of columns.   */
  441. X    short    t_margin;        /* min margin for extended lines*/
  442. X    short    t_scrsiz;        /* size of scroll region "    */
  443. X    int    t_pause;        /* # times thru update to pause */
  444. X        int     (*t_open)();            /* Open terminal at the start.  */
  445. X        int     (*t_close)();           /* Close terminal at end.       */
  446. X    int    (*t_kopen)();        /* Open keyboard        */
  447. X    int    (*t_kclose)();        /* close keyboard        */
  448. X        int     (*t_getchar)();         /* Get character from keyboard. */
  449. X        int     (*t_putchar)();         /* Put character to display.    */
  450. X        int     (*t_flush)();           /* Flush output buffers.        */
  451. X        int     (*t_move)();            /* Move the cursor, origin 0.   */
  452. X        int     (*t_eeol)();            /* Erase to end of line.        */
  453. X        int     (*t_eeop)();            /* Erase to end of page.        */
  454. X        int     (*t_beep)();            /* Beep.                        */
  455. X    int    (*t_rev)();        /* set reverse video state    */
  456. X    int    (*t_rez)();        /* change screen resolution    */
  457. X#if    COLOR
  458. X    int    (*t_setfor)();        /* set forground color        */
  459. X    int    (*t_setback)();        /* set background color        */
  460. X#endif
  461. X}       TERM;
  462. X
  463. X/*    TEMPORARY macros for terminal I/O  (to be placed in a machine
  464. X                        dependant place later)    */
  465. X
  466. X#define    TTopen        (*term.t_open)
  467. X#define    TTclose        (*term.t_close)
  468. X#define    TTkopen        (*term.t_kopen)
  469. X#define    TTkclose    (*term.t_kclose)
  470. X#define    TTgetc        (*term.t_getchar)
  471. X#define    TTputc        (*term.t_putchar)
  472. X#define    TTflush        (*term.t_flush)
  473. X#define    TTmove        (*term.t_move)
  474. X#define    TTeeol        (*term.t_eeol)
  475. X#define    TTeeop        (*term.t_eeop)
  476. X#define    TTbeep        (*term.t_beep)
  477. X#define    TTrev        (*term.t_rev)
  478. X#define    TTrez        (*term.t_rez)
  479. X#if    COLOR
  480. X#define    TTforg        (*term.t_setfor)
  481. X#define    TTbacg        (*term.t_setback)
  482. X#endif
  483. X
  484. X/*    structure for the table of initial key bindings        */
  485. X
  486. Xtypedef struct  {
  487. X        short   k_code;                 /* Key code                     */
  488. X        int     (*k_fp)();              /* Routine to handle it         */
  489. X}       KEYTAB;
  490. X
  491. X/*    structure for the name binding table        */
  492. X
  493. Xtypedef struct {
  494. X    char *n_name;        /* name of function key */
  495. X    int (*n_func)();    /* function name is bound to */
  496. X}    NBIND;
  497. X
  498. X/*    The editor holds deleted text chunks in the KILL buffer. The
  499. X    kill buffer is logically a stream of ascii characters, however
  500. X    due to its unpredicatable size, it gets implemented as a linked
  501. X    list of chunks. (The d_ prefix is for "deleted" text, as k_
  502. X    was taken up by the keycode structure)            */
  503. X
  504. Xtypedef    struct KILL {
  505. X    struct KILL *d_next;    /* link to next chunk, NULL if last */
  506. X    char d_chunk[KBLOCK];    /* deleted text */
  507. X} KILL;
  508. X
  509. END_OF_estruct.h
  510. if test 18184 -ne `wc -c <estruct.h`; then
  511.     echo shar: \"estruct.h\" unpacked with wrong size!
  512. fi
  513. # end of overwriting check
  514. fi
  515. echo shar: Extracting \"readme\" \(20974 characters\)
  516. if test -f readme ; then 
  517.   echo shar: Will not over-write existing file \"readme\"
  518. else
  519. sed "s/^X//" >readme <<'END_OF_readme'
  520. X        MicroEMACS 3.8b Release Notes
  521. X
  522. X**********************************************************************
  523. X
  524. X    (C)opyright 1987 by Daniel M. Lawrence
  525. X    MicroEMACS 3.8 can be copied and distributed freely for any
  526. X    non-commercial purposes. MicroEMACS 3.8 can only be incorporated
  527. X    into commercial software with the permission of the current author.
  528. X
  529. X(    Notice the copyright.....a number of large companies decided to use
  530. XMicroEMACS 3.7 and 3.7i as the shell of their products, and several of
  531. Xthe ones I contacted were not even courteos enough to send me their
  532. Xproduct for my personal use.  I am not out to make a fortune on this,
  533. Xbut a little common courtesy would be appreciated.)
  534. X
  535. X**********************************************************************
  536. X
  537. X    It has been quite a while since the last realease and there are
  538. Xa large number of new features and enhancements to old features.  There
  539. Xis now a full extension language and there is also support nearly
  540. Xcompleted for a number of newer 68000 machines.  The edit history at the
  541. Xbeginning of the MAIN.C file details the changes. 
  542. X
  543. X    MicroEMACS 3.8 is availible in a couple of different ways. 
  544. XFirst, it is availible via my bulletin board system..... 
  545. X
  546. X    The Programmer's Room
  547. X    FIDO 201/2
  548. X    (317) 742-5533
  549. X    24 hours  300/1200 baud
  550. X
  551. X    Also it should be online on the following BBS's:
  552. X
  553. X    The Starship Trooper    Fido 201/1    (317) 423-2281    2400
  554. X    Avatar            Fido 201/4    (317) 497-1970    1200
  555. X
  556. X    There it is arranged as three MSDOS .ARC files, EMACSDOC.ARC
  557. Xwhich contains the documentation and command files, EMACSSRC.ARC which
  558. Xcontains the sources and the UNIX Makefile, and EMACSEXE.EXE which
  559. Xcontains the MSDOS executables.  Also all the various executables are
  560. Xavailibile individualy. 
  561. X
  562. XEMACSDOC.ARC includes the files:
  563. X
  564. X    README        This file
  565. X    
  566. X    EMACS.RC    Standard startup file
  567. X    ME110.RC    HP110 startup file
  568. X    ME150.RC    HP150 startup file
  569. X    
  570. X    
  571. X    EMACS.HLP    Online help file
  572. X    EMACS.KEY    Cammond wallchart
  573. X    EMACS.TUT    Online tutorial
  574. X    EMACS.MSS       Emacs Introduction document
  575. X    EMACS1.MSS    Emacs Reference guide
  576. X    IBMFN.LST    IBM-PC function list
  577. X    MAGIC.DOC    Regular partern matching bulletin
  578. X    
  579. X    AZMAP.CMD    Translate .SYM files to .MAP
  580. X    BDATA.CMD    BASIS Data statement builder
  581. X    MENU.CMD    Sample Menu system
  582. X    MENU1           datafile for menu syste
  583. X
  584. XEMACSSRC.ARC includes the files:
  585. X
  586. X    ANSI.C        ANSI screen driver
  587. X    BASIC.C        basic cursor movement
  588. X    BIND.C        key binding commands
  589. X    BUFFER.C    buffer manipulation commands
  590. X    CRYPT.C        encryption functions
  591. X    DG10.C        Data General 10 screen driver
  592. X    DISPLAY.C    main display driver
  593. X    EBIND.H        binding list
  594. X    EDEF.H        global variable declarations
  595. X    EFUNC.H        function name list
  596. X    EGAPC.C        EGA screen driver
  597. X    EPATH.H        default path settings
  598. X    ESEARCH.H    search global declarations
  599. X    ESTRUCT.H    configuration and structure definitions
  600. X    EVAL.C        expresion evaluator
  601. X    EVAR.H        EMACS macro variable declarations
  602. X    EXEC.C        macro execution functions
  603. X    FILE.C        user file functions
  604. X    FILEIO.C    low level file I/O driver
  605. X    HP110.C        HP110 screen driver
  606. X    HP150.C        HP150(A or C) screen driver
  607. X    IBMPC.C        IBM-PC CGA and MONOCHROME driver
  608. X    INPUT.C        low level user input driver
  609. X    ISEARCH.C    incremental search functions
  610. X    LINE.C        text line manipulation functions
  611. X    LOCK.C        file locking functions
  612. X    MAIN.C        argument parsing and command loop
  613. X    RANDOM.C    other random user functions
  614. X    REGION.C    region cut & paste functions
  615. X    SEARCH.C    search and replace functions
  616. X    SPAWN.C        OS interface driver
  617. X    ST520.C        ATARI ST1040 screen driver [not verified]
  618. X    TCAP.C        Termcap screen driver
  619. X    TERMIO.C    low level I/O driver
  620. X    TIPC.C        TI-PC screen driver
  621. X    VMSVT.C        VMS screen driver
  622. X    VT52.C        VT52 screen driver
  623. X    WINDOW.C    window manipulation functions
  624. X    WORD.C        word manipulation functions
  625. X
  626. XEMACSEXE.ARC includes the files:
  627. X
  628. X    MEIBM.EXE    IBM-PC CGA and MONO version
  629. X    MEEGA.EXE    IBM-PC EGA version
  630. X    MEANSI.EXE    MSDOS ANSI graphics version
  631. X    ME110.EXE    HP110 portable version
  632. X    ME150.EX    HP150 version
  633. X
  634. X    Also MicroEMACS should be availible from USENET via the
  635. Xmod.sources notegroup, or its archives. A number of sites also make
  636. XMicroEMACS availible via FTP. Watch USENET news for info on these.
  637. X
  638. X    MicroSCRIBE 1.0, which I had hoped to have ready by now, is only
  639. Xabout half written.  MicroEMACS took up more of my time in updates then
  640. XI had expected, however having this fairly advanced, and hopefully
  641. Xfairly stable version, I can get back to getting MicroSCRIBE written. 
  642. XAlso in the works for a later release is a spell checker (called
  643. XMicroSPELL rather predictably) and sometime next year, a integrated
  644. Xthesaurus program. 
  645. X
  646. X    A more customized MicroEMACS for the Macintosh, the Amiga and
  647. Xthe 1040ST will probably become availible in the next couple of months. 
  648. XSupport for the mouse, standard file boxes, pull down menus and
  649. Xdifferent resolutions will be included.  If you can be of help in
  650. Xgetting this ready, please contact me. 
  651. X
  652. X    As before, I will continue to support these programs, and
  653. Xencourage everyone to spread them around as much as they can. If you
  654. Xmake what you think are changes that are usefull to many, send me the
  655. Xupdates, and as time permits, I will encorporate the ones I understand,
  656. Xand agree with into the master sources. Being overswamped with mailers,
  657. XI have discontinued my mailing offer, but if you have a special problem
  658. Xgetting hold of MicroEMACS, contact me and we can work something out for
  659. Xyou.
  660. X
  661. X    USmail:    Daniel Lawrence
  662. X        617 New York St
  663. X        Lafayette, IN 47901
  664. X
  665. X    UUCP:    ihnp4!pur-ee!pur-phy!duncan!lawrence
  666. X    or    ihnp4!itivax!duncan!lawrence
  667. X    ARPA:    nwd@j.cc.purdue.edu
  668. X    FIDO:    The Programmer's Room 201/2
  669. X        (317) 742-5533
  670. X    ATT:    (317) 742-5153
  671. X
  672. X
  673. X
  674. X
  675. X        New Features
  676. X        ============
  677. X
  678. X***    Path Searching
  679. X
  680. X    If the OS of the operating system MicroEMACS is running under
  681. Xhas environmental variables, MicroEMACS will read in the PATH variable
  682. Xas a list of directories in which to look for its startup and help
  683. Xfiles, in place of the list in the epath.h file.
  684. X
  685. X***    Bindable Prefixes
  686. X
  687. X    All the prefix keys can now be rebound. This includes:
  688. X
  689. X        meta-prefix        <ESC>
  690. X        ctlx-prefix        ^X
  691. X        universal-argument    ^U
  692. X        quote-character        ^Q
  693. X
  694. X***    HP150 function keys
  695. X
  696. X    can now both be labeled and bound.
  697. X
  698. X***    New Help Function
  699. X
  700. X    The APROPOS (M-A) function prompts for a string, and then
  701. Xprepares a list of all named functions that contain the string. This is
  702. Xusefull for finding all comands that deal with one topic.
  703. X
  704. X***    File Encryption
  705. X
  706. X    Text files can now be encrypted (and decrypted <very useful>).
  707. XThe encryption method (written by Dana Hoggat) results in ALL legal
  708. Xprinting characters, leaving files suitable for mailing and moving
  709. Xaround between systems. The -k <encryption key> command line switch
  710. Xplaces the first file into the edit buffer using the named key. CRYPT is
  711. Xa mode which can be set on any buffer, and set-encryption-key (M-E) sets
  712. Xthe encryption key of the current buffer. If you attempt to write out a
  713. Xbuffer in crypt mode without specifying the key, MicroEMACS will
  714. Xautomatically prompt you for it.
  715. X
  716. X***    Keyboard Macros rewritten
  717. X
  718. X    The code for processing keyboard macros now records the responses
  719. Xto all prompts as well as just the command keystrokes.
  720. X
  721. X***    Restrictive Mode
  722. X
  723. X    The -r command line switch prevents EMACS from executing many of
  724. Xits commands which would allow you to break out of it, or edit files
  725. Xother then the ones named on the command line.  This is usefull for
  726. Xproducts that need to restrict access to the OS from inside the editor
  727. X(for example, BBS systems).
  728. X
  729. X***    Word wrap made more flexible
  730. X
  731. X    When emacs determined it is time to word wrap (when in wrap
  732. Xmode) it calls the function which is bound to the illegal keystroke,
  733. XM-FNW. This keystroke is normally bound to wrap-word (M-FNW), but can be
  734. Xrebound by the user so EMACS can do different things at wrap time (like
  735. Xauto indention in different languages).
  736. X
  737. X***    Fence Matching
  738. X
  739. X    The goto-matching-fence (M-^F) command jumps the cursor to the
  740. Xmatching fence, or beeps if there is none.
  741. X
  742. X***    Dynamic Screen Re-sizing
  743. X
  744. X    The size that EMACS uses for editing can be changed with the
  745. Xchange-screen-size (M-^S) and change-screen-width (M-^T) commands. These
  746. Xcan then be usefull in integrating EMACS on window based machines.
  747. X
  748. X***    IBMPC drivers combined...
  749. X
  750. X    The IBM-PC CGA and MONOCHROME drivers have been combined into
  751. Xone driver which will look up the graphics adapter type at startup and
  752. Xadjust accordingly.
  753. X
  754. X***    EXTENTION LANGUAGE
  755. X
  756. X    MicroEMACS is now equipped with a fully functional extention
  757. Xlanguage in which to write macros.  These macros can be saved, recalled
  758. Xand bound to keystrokes, thus allowing a high degree of customization. 
  759. XWhat follows is an exerpt from what will become the new MicroEMACS
  760. Xreference manual. 
  761. X
  762. XChapter x:        MicroEMACS Macros
  763. X
  764. X    Macros are programs that are used to customize the editor and to
  765. Xperform complicated editing tasks.  They may be stored in files or
  766. Xbuffers and may be executed using an appropriate command, or bound to a
  767. Xparticular keystroke.  Portions of the standard start-up file are
  768. Ximpliment via macros, as well as the example menu system.  The
  769. Xexecute-macro-<n> editor commands cause the macros, numbered from 1 to
  770. X40, to be executed.  Macros are stored by executing files that contain
  771. Xthe store-macro command.
  772. X
  773. X    There are many different aspects to the macro langage within
  774. XMicroEMACS.  Editor commands are the various commands that manipulate
  775. Xtext, buffers, windows, etc, within the editor.  Directives are commands
  776. Xwhich control what lines get executed within a macro.  Also there are
  777. Xvarious types of variables.  Environmental variables both control and
  778. Xreport on different aspects of the editor.  User variables hold string
  779. Xvalues which may be changed and inspected.  Buffer variables allow text
  780. Xto be placed into variables.  Interactive variable allow the program to
  781. Xprompt the user for information.  Functions can be used to manipulate
  782. Xall these variables. 
  783. X
  784. Xx.00    Variables
  785. X
  786. X    Variables in MicroEMACS can be used to return values within
  787. Xexpressions, as repeat counts to editing commands, or as text to be
  788. Xinserted into buffers and messages.  The value of these variables is set
  789. Xusing the set (^X-A) command.  For example, to set the current fill
  790. Xcolumn to 64 characters, the following macro line would be used:
  791. X
  792. X    set $fillcol 64
  793. X
  794. X    or to have the contents of %NAME inserted at the point in the
  795. Xcurrent buffer, the command to use would be:
  796. X
  797. X    insert-string %name
  798. X
  799. X
  800. Xx.01    Environmental Variables
  801. X
  802. X    "What good is a quote if you can't change it?"
  803. X
  804. X    These variables are used to change different aspects of the way
  805. Xthe editor works.  Also they will return the current settings if used as
  806. Xpart of an expresion.  All environmental variable names begin with a
  807. Xdollar sign ($). 
  808. X
  809. X    $fillcol    Current fill column
  810. X    $pagelen    Number of screen lines used currently
  811. X    $curwidth    Number of columns used currently
  812. X    $curcol        Current column of point in current buffer
  813. X    $curline    Current line of point in current buffer
  814. X    $flicker    Flicker Flag
  815. X                set to TRUE if IBM CGA
  816. X                set to FALSE for most others
  817. X    $cbufname    Name of the current buffer
  818. X    $cfname        File name of the current buffer
  819. X    $sres        Current screen resolution
  820. X            (CGA or MONO on the IBM-PC driver...
  821. X             EGA on the EGA driver
  822. X             LOW MEDIUM or HIGH on the Atari ST1040
  823. X             NORMAL on all others)
  824. X    $debug        Flag to trigger macro debugging (try it...
  825. X                you'll like it!)
  826. X    $status        return status of the success of the last command
  827. X            (TRUE or FALSE) usually used with !force
  828. X
  829. X    Obviously, many more of these variables will be availible in
  830. Xfuture releases of MicroEMACS. (Yes, send a vote for your favorite new
  831. Xenvironmental variables today).
  832. X
  833. Xx.02    User variables
  834. X
  835. X    User variables allow you, the user, to store strings and
  836. Xmanipulate them.  These strings can be pieces of text, numbers (in text
  837. Xform), or the logical values TRUE and FALSE.  These variables can be
  838. Xcombined, tested, inserted into buffers, and otherwise used to control
  839. Xthe way your macros execute. At the moment, up to 100 user variables may
  840. Xbe in use in one editing session.  All users variable names must begin
  841. Xwith a percent sign (%) and may contain any printing characters.  Only
  842. Xthe first 10 characters are significant (ie differences beyond the tenth
  843. Xcharacter are ignored). Most operators will truncate strings to a length
  844. Xof 128 characters.
  845. X
  846. Xx.03    Buffer Variables
  847. X
  848. X    Buffer variables are special in that they can only be queried
  849. Xand cannot be set.  What buffer variables are is a way to take text from
  850. Xa buffer and place it in a variable. For example, if I have a buffer by
  851. Xthe name of RIGEL2, and it contains the text:
  852. X
  853. X    Richmond
  854. X    Lafayette
  855. X    <*>Bloomington        (where <*> is the current point)
  856. X    Indianapolis
  857. X    Gary
  858. X    =* MicroEMACS 3.8 (WRAP) == rigel2 == File: /data/rigel2.txt =====
  859. X
  860. X    and within a command I reference #rigel2, like:
  861. X
  862. X    insert-string #rigel2
  863. X
  864. X    MicroEMACS would start at the current point in the RIGEL2
  865. Xbuffer and grab all the text up to the end of that line and pass that
  866. Xback.  Then it would advance the point to the beginning of the next line.
  867. XThus, after our last command executes, the string "Bloomington" gets
  868. Xinserted into the current buffer, and the buffer RIGEL2 now looks like
  869. Xthis:
  870. X
  871. X    Richmond
  872. X    Lafayette
  873. X    Bloomington
  874. X    <*>Indianapolis        (where <*> is the current point)
  875. X    Gary
  876. X    =* MicroEMACS 3.8 (WRAP) == rigel2 == File: /data/rigel2.txt =====
  877. X
  878. X    as you have probably noticed, a buffer variable consists of the
  879. Xbuffer name, preceded by a pound sign (#).
  880. X
  881. Xx.04    Interactive variables
  882. X
  883. X    Interactive variables are actually a method to prompt the user
  884. Xfor a string.  This is done by using an at sign (@) followed either with
  885. Xa quoted string, or a variable containing a string.  The string is the
  886. Xplaced on the bottom line, and the editor waits for the user to type in
  887. Xa string.  Then the string typed in by the users is returned as the
  888. Xvalue of the interactive variable.  For example:
  889. X
  890. X    set %quest "What file? "
  891. X    find-file @%quest
  892. X
  893. X    will ask the user for a file name, and then attempt to find it.
  894. X
  895. X
  896. Xx.10    Functions
  897. X
  898. X    Functions can be used to manipulate variables in various ways. 
  899. XFunctions can have one, two, or three arguments.  These arguments will
  900. Xalways be placed after the function on the current command line.  For
  901. Xexample, if we wanted to increase the current fill column by two, using
  902. Xemacs's set (^X-A) command, we would write:
  903. X
  904. X    set $fillcol &add $fillcol 2
  905. X         \      \      \      \     \____second operand
  906. X           \      \      \      \________first operand
  907. X             \      \      \_____________function to execute
  908. X               \      \__________________variable to set
  909. X                 \_______________________set (^X-A) command
  910. X
  911. X    Function names always begin with the ampresand (&) character,
  912. Xand are only significant to the first three characters after the
  913. Xampresand.  Functions will normal expect one of three types of
  914. Xarguments, and will automatically convert types when needed.
  915. X
  916. X    <num>    an ascii string of digits which is interpeted as a
  917. X        numeric value.  Any string which does not start with a
  918. X        digit or a minus sign (-) will be considered zero.
  919. X
  920. X    <str>    An arbitrary string of characters.  At the moment,
  921. X        strings are limited to 128 characters in length.
  922. X
  923. X    <log>    A logical value consisting of the string "TRUE" or
  924. X        "FALSE". Numeric strings will also evaluate to "FALSE"
  925. X        if they are equal to zero, and "TRUE" if they are
  926. X        non-zero. Arbitrary text strings will have the value of
  927. X        "FALSE".
  928. X
  929. X    A list of the currently availible functions follows: (Once
  930. Xagain, send in those votes on what kind of functions you would like to
  931. Xsee added!)
  932. X
  933. XNumeric Functions:    (returns <num>)
  934. X
  935. X&ADD        <num> <num>    Add two numbers
  936. X&SUB        <num> <num>    Subtract the second number from the first
  937. X&TIMes        <num> <num>    Multiply two numbers
  938. X&DIVide        <num> <num>    Divide the first number by the second
  939. X                giving an integer result
  940. X&MOD        <num> <num>    Return the reminder of dividing the
  941. X                first number by the second
  942. X&NEGate        <neg>        Multiply the arg by -1
  943. X
  944. X
  945. XString manipulation functions:    (returns <str>)
  946. X
  947. X&CAT        <str> <str>    Concatinate the two strings to form one
  948. X&LEFt        <str> <num>    return the <num> leftmost characters
  949. X                from <str>
  950. X&RIGht        <str> <num>    return the <num> rightmost characters
  951. X                from <str>
  952. X&MID        <str> <num1> <num2>
  953. X                Starting from <num1> position in <str>,
  954. X                return <num2> characters.
  955. X
  956. XLogical Testing functions:    (returns <log>)
  957. X
  958. X&NOT        <log>        Return the opposite logical value
  959. X&EQUal        <num> <num>    If <num> and <num> are numerically
  960. X                equal, return TRUE
  961. X&LESs        <num1> <num2>    If <num1> is less than <num2>, return
  962. X                TRUE.
  963. X&GREater    <num1> <num2>    If <num1> is greater than, or equal to
  964. X                <num2>, return TRUE.
  965. X&SEQual        <str1> <str2>    If the two strings are the same, return
  966. X                TRUE.
  967. X&SLEss        <str1> <str2>    If <str1> is less alphabetically than
  968. X                <str2>, return TRUE.
  969. X&SGReater    <str1> <str2>    If <str1> is alphabetically greater than
  970. X                or equal to <str2>, return TRUE.
  971. X
  972. XSpecial Functions:
  973. X
  974. X&INDirect    <str>        Evaluate <str> as a variable.
  975. X
  976. X    This last function deserves more explaination. The &IND function
  977. Xevaluates its argument, takes the resulting string, and then uses it as
  978. Xa variable name.  For example, given the following code sequence:
  979. X
  980. X    ; set up reference table
  981. X
  982. X    set %one    "elephant"
  983. X    set %two     "giraffe"
  984. X    set %three     "donkey"
  985. X
  986. X    set %index "two"
  987. X    insert-string &ind %index
  988. X
  989. X    the string "giraffe" would have been inserted at the point in
  990. Xthe current buffer.  This indirection can be safely nested up to about
  991. X10 levels.
  992. X
  993. Xx.20    Directives
  994. X
  995. X    Directives are commands which only operate within an executing
  996. Xmacro, ie they do not make sense as a single command. As such, they
  997. Xcannot be called up singly or bound to keystroke. Used within macros,
  998. Xthey control what lines are executed and in what order.
  999. X
  1000. X    Directives always start with the exlaimation mark (!) character
  1001. Xand must be the first thing placed on a line. Directives executed singly
  1002. X(via the execute-command-line command) interactively will be ignored.
  1003. X
  1004. Xx.21    !ENDM Directive
  1005. X
  1006. X    This directive is used to terminate a macro being stored. For
  1007. Xexample, if a file is being executed contains the text:
  1008. X
  1009. X    ;    Read in a file in view mode, and make the window red
  1010. X    26    store-macro
  1011. X        find-file @"File to view: "
  1012. X        add-mode "view"
  1013. X        add-mode "red"
  1014. X    !endm
  1015. X
  1016. X    write-message "[Consult macro has been loaded]"
  1017. X
  1018. X    only the lines between the store-macro command and the !ENDM
  1019. Xdirective are stored in macro 26.
  1020. X
  1021. Xx.22    !FORCE Directive
  1022. X
  1023. X    When MicroEMACS executes a macro, if any command fails, the
  1024. Xmacro is terminated at that point. If a line is preceeded by a !FORCE
  1025. Xdirective, execution continues weather the command succeeds or not. For
  1026. Xexample:
  1027. X
  1028. X    ;    Merge the top two windows
  1029. X
  1030. X    save-window        ;remember what window we are at
  1031. X    1 next-window        ;go to the top window
  1032. X    delete-window        ;merge it with the second window
  1033. X    !force restore-window    ;This will continue irregardless
  1034. X    add-mode "red"
  1035. X
  1036. Xx.23    !IF, !ELSE, and !ENDIF Directives
  1037. X
  1038. X    This directive allows statements only to be executed if a
  1039. Xcondition specified in the directive is met.  Every line following the
  1040. X!IF directive, until the first !ELSE or !ENDIF directive, is only
  1041. Xexecuted if the expresion following the !IF directive evaluates to a
  1042. XTRUE value.  For example, the following macro segment creates the
  1043. Xportion of a text file automatically.  (yes believe me, this will be
  1044. Xeasier to understand then that last explaination....)
  1045. X
  1046. X    !if &sequal %curplace "timespace vortex"
  1047. X        insert-string "First, rematerialize~n"
  1048. X    !endif
  1049. X    !if &sequal %planet "earth"    ;If we have landed on earth...
  1050. X        !if &sequal %time "late 20th century"  ;and we are then
  1051. X            write-message "Contact U.N.I.T."
  1052. X        !else
  1053. X            insert-string "Investigate the situation....~n"
  1054. X            insert-string "(SAY 'stay here Sara')~n"
  1055. X        !endif
  1056. X    !else
  1057. X        set %conditions @"Atmosphere conditions outside? "
  1058. X        !if &sequal %conditions "safe"
  1059. X            insert-string &cat "Go outside......" "~n"
  1060. X            insert-string "lock the door~n"
  1061. X        !else
  1062. X            insert-string "Dematerialize..try somewhen else"
  1063. X            newline
  1064. X        !endif
  1065. X    !endif
  1066. X
  1067. Xx.24    !GOTO Directive
  1068. X
  1069. X    Flow can be controlled within a MicroEMACS macro using the !GOTO
  1070. Xdirective. It takes as an argument a label. A label consists of a line
  1071. Xstarting with an asterick (*) and then an alphanumeric label.  Only
  1072. Xlabels in the currently executing macro can be jumped to, and trying to
  1073. Xjump to a non-existing label terminates execution of a macro.  For
  1074. Xexample..
  1075. X
  1076. X    ;Create a block of DATA statements for a BASIC program
  1077. X
  1078. X        insert-string "1000 DATA "
  1079. X        set %linenum 1000
  1080. X
  1081. X    *nxtin
  1082. X        update-screen        ;make sure we see the changes
  1083. X        set %data @"Next number: "
  1084. X        !if &equal %data 0
  1085. X            !goto finish
  1086. X        !endif
  1087. X
  1088. X        !if &greater $curcol 60
  1089. X            2 delete-previous-character
  1090. X            newline
  1091. X            set %linenum &add %linenum 10
  1092. X            insert-string &cat %linenum " DATA "
  1093. X        !endif
  1094. X
  1095. X        insert-string &cat %data ", "
  1096. X        !goto nxtin
  1097. X
  1098. X    *finish
  1099. X
  1100. X        2 delete-previous-character
  1101. X        newline
  1102. X
  1103. Xx.25    !RETURN Directive
  1104. X
  1105. X    The !RETURN Directive causes the current macro to exit, either
  1106. Xreturning to the caller (if any) or to interactive mode.  For example:
  1107. X
  1108. X    ;    Check the monitor type and set %mtyp
  1109. X
  1110. X    !if &sres "CGA"
  1111. X        set %mtyp 1
  1112. X        !return
  1113. X    !else
  1114. X        set %mtyp 2
  1115. X    !endif
  1116. X
  1117. X    insert-string "You are on a MONOCHROME machine!~n"
  1118. X
  1119. X<<<END OF MANUAL EXCERPT>>>
  1120. END_OF_readme
  1121. if test 20974 -ne `wc -c <readme`; then
  1122.     echo shar: \"readme\" unpacked with wrong size!
  1123. fi
  1124. # end of overwriting check
  1125. fi
  1126. echo shar: End of archive 8 \(of 14\).
  1127. cp /dev/null ark8isdone
  1128. MISSING=""
  1129. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1130.     if test ! -f ark${I}isdone ; then
  1131.     MISSING="${MISSING} ${I}"
  1132.     fi
  1133. done
  1134. if test "${MISSING}" = "" ; then
  1135.     echo You have unpacked all 14 archives.
  1136.     echo "See the readme file"
  1137.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1138. else
  1139.     echo You still need to unpack the following archives:
  1140.     echo "        " ${MISSING}
  1141. fi
  1142. ##  End of shell archive.
  1143. exit 0
  1144.